import Vue from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'

Vue.config.productionTip = false

//1.引入全局的公共样式
import "@/styles/index.scss"

// 2. 全局混入 
import "@/utils/mixins"

// 3. 引入vant
import Vant,{Lazyload,ImagePreview} from 'vant';
import 'vant/lib/index.css'; //vant UI 组件库的CSS
Vue.use(Vant);
Vue.use(Lazyload);
Vue.use(ImagePreview);
//注册时可以配置额外的选项
Vue.use(Lazyload,{
  lazyComponent:true,
})

// 适配 
// 4. 淘宝适配 根据rem等比缩放
import "lib-flexible"

// 5.事件中央总线
import {
  bus
} from '@/utils/bus'
Vue.prototype.$bus = bus

// 6.全局的axios
import {axios} from '@/api/request'
Vue.prototype.$axios = axios

// 7.全局注册组件
import '@/components'

//8.挂载ajax axios的封装
import {ajax} from '@/api'
Vue.prototype.$ajax=ajax

//9.全局的过滤器
import "@/utils/golbal"

//针对日期格式转换
import moment from "moment"
moment.locale()

//10.全局的正则表达式
import {reg} from '@/utils/validata'
Vue.prototype.$reg=reg


new Vue({
  //挂载到根实例
  router, //this.$router
  store, //this.$store
  render: h => h(App)
}).$mount('#app')
